Fix AutoScheme low memory flag propagation from CLI#1596
Merged
Conversation
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
…ix_cli_low_cpu_mem
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes inconsistent memory-strategy behavior when AutoScheme is invoked via the CLI --avg_bits/--options path by ensuring the same low-memory flags used by the main AutoRound flow are applied to AutoScheme.
Changes:
- Move
low_cpu_mem_usageresolution earlier so it’s available before AutoScheme construction. - Pass
low_gpu_mem_usageandlow_cpu_mem_usageinto theAutoScheme(...)constructor when--avg_bitsis used. - Update the CLI help text for the deprecated
--low_cpu_mem_usageflag.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
chensuyue
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes inconsistent memory-mode behavior between the main AutoRound flow and AutoScheme when running from CLI.
low_gpu_mem_usage and low_cpu_mem_usage from CLI were passed to AutoRound but were not passed to AutoScheme.
This caused AutoScheme to run under a different memory strategy than the main quantization flow, which could lead to unexpectedly high CPU RAM usage and misleading memory behavior during AutoScheme generation.
CUDA_VISIBLE_DEVICES=6 python -m auto_round /mnt/disk2/lvl/Qwen3-1.7B/ --target_bits 2.5 --ignore_scale_zp_bits --options "gguf:q2_k_s,gguf:q4_k_s" --iters 1 --nsamples 16
Before fix:

After fix:

Type of Change
Related Issues
#1586
Checklist Before Submitting